﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Exp.BillDLL.biz;
using Exp.BillDLL.ety;
using Bill.BasDLL.ety;

namespace ExpBillMain.form
{
    public partial class frmBillResult : Dev.Control.BaseFormDev
    {
        bizExpDetail bzExpDetail;
        etyTmYmsYD eyTmYms = new etyTmYmsYD();

        public frmBillResult(etyTmYmsYD ieyTmYms)
        {
            InitializeComponent();
            eyTmYms = ieyTmYms;
        }

        private void frmBillResult_Load(object sender, EventArgs e)
        {
            bzExpDetail = new bizExpDetail(_Global.basSysPara);

            IList<etyTmYmsYD> ilYmsYD = new List<etyTmYmsYD>();
            etyTmYmsYD eyEty = new etyTmYmsYD();

            //ggcDocList.GridView = this.gridView1;
            //string sMapingCols = "YID,YD_NO,CLIENT_NAME,YW_TYPE_DESC,SF_DESC,CITY_DESC,QX_DESC,YF_AMT,CREATE_TIME,QTY,WGT,ELE_CONFIRM";
            //string sMapingHeaderTxt = "序号,详情单号,客户名称,业务类型,省份,市,区,金额,时间,数量,重量,电子客户确认";
            //string sColumnWidth = string.Empty;
            //ggcDocList.ColumnsMappingCreate(sMapingCols, sMapingHeaderTxt);
            //this.winUtil.LoadGridLayout(ggcDocList);
            //ggcDocList.DataSource = ilYmsYD;
            //ggcDocList.GridView.OptionsView.ShowGroupPanel = true;

            TT.Common.formProcess.SetFormEntity(eyTmYms, this.grpFlow);

            IList<etyBillPrice> ilBillPrice = bzExpDetail.GetDetailPriceSeq(eyTmYms);

            TT.Common.formProcess.SetFormEntity(ilBillPrice[0], this.grpPriceSet);
            TT.Common.formProcess.SetFormEntity(ilBillPrice[0], this.gpPrice);

            foreach (Control ctrl in gpPrice.Controls)
            {
                if (ctrl is RadioButton)
                {
                    RadioButton radBtn = (RadioButton)ctrl;
                    if (radBtn.Tag.ToString() == ilBillPrice[0].METHOD)
                    {
                        radBtn.Checked = true;
                        break;
                    }
                }
            }
        }

        private void tsbExit_Click(object sender, EventArgs e)
        {
            F12();
        }

        public override Dev.Control.etyQuickKey F12()
        {
            return base.F12();
        }
    }
}
